package com.wuxiaofan.product.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wuxiaofan.product.entity.SkuImages;
import com.wuxiaofan.product.entity.custom.SkuImagesCustom;
import com.wuxiaofan.product.mapper.SkuImagesMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.wuxiaofan.product.client.Idgenerator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;

@Service
public class SkuImagesService {
    @Autowired
    private SkuImagesMapper pmsSkuImagesMapper;
    @Resource
    private Idgenerator idgenerator;
    public SkuImages findById(String id){
        return pmsSkuImagesMapper.selectById(id);
    }

    public SkuImagesCustom findCountByMap(Map paraMap){
        return pmsSkuImagesMapper.findCountByMap(paraMap);
    }

    public SkuImagesCustom findGroupByMap(Map paraMap){
        return pmsSkuImagesMapper.findGroupByMap(paraMap);
    }

    public List<SkuImagesCustom> findByMap(Map paraMap){
        return pmsSkuImagesMapper.findByMap(paraMap);
    }

    public Page<SkuImagesCustom> findByMap(Map paraMap, Page page){
        return page.setRecords(pmsSkuImagesMapper.findByMap(paraMap,page));
    }


    public void updateMapById(Map paraMap){
        pmsSkuImagesMapper.updateMapById(paraMap);
    }
    public void delById(String id){
        pmsSkuImagesMapper.deleteById(id);
    }

    public SkuImages save(SkuImages pmsSkuImages){
        pmsSkuImages.setId(idgenerator.getId());
        pmsSkuImagesMapper.insert(pmsSkuImages);
        return pmsSkuImages;
    }

}
